<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="http://www.petercorke.com/RVC/common/toolboxhelp.css">
    <title>M-File Help: iread</title>
  </head>
  <body>
  <table border="0" cellspacing="0" width="100%">
    <tr class="subheader">
      <td class="headertitle">M-File Help: iread</td>
      <td class="subheader-left"><a href="matlab:open iread">View code for iread</a></td>
    </tr>
  </table>
<h1>iread</h1><p><span class="helptopic">Read image from file</span></p><strong>im</strong> = <span style="color:red>iread</span>() presents a file selection GUI from which the user can select
an image file which is returned as 2D or 3D matrix.  On subsequent calls
the initial folder is as set on the last call.

<strong>im</strong> = <span style="color:red>iread</span>(<strong>file</strong>, <strong>options</strong>) reads the specified file and returns a matrix.  If
the path is relative it is searched for on Matlab search path.

Wildcards are allowed in file names.  If multiple files match a 3D or 4D image
is returned where the last dimension is the number of images in the sequence.

<h2>Options</h2>
<table class="list">
  <tr><td style="white-space: nowrap;" class="col1"> 'uint8'</td> <td>return an image with 8-bit unsigned integer pixels in
the range 0 to 255</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'single'</td> <td>return an image with single precision floating point pixels
in the range 0 to 1.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'double'</td> <td>return an image with double precision floating point pixels
in the range 0 to 1.</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'grey'</td> <td>convert image to greyscale if it's color using ITU rec 601</td></tr>
  <tr><td style="white-space: nowrap;" class="col1"> 'grey_709'</td> <td>convert image to greyscale if it's color using ITU rec 709</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'gamma', G</td> <td>gamma value, either numeric or 'sRGB'</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'reduce', R</td> <td>decimate image by R in both dimensions</td></tr>
  <tr><td style="white-space: nowrap;" class="col1">'roi', R</td> <td>apply the region of interest R to each image,
where R=[umin umax; vmin vmax].</td></tr>
</table>
<h2>Notes</h2>
<ul>
  <li>A greyscale image is returned as an HxW matrix</li>
  <li>A color image is returned as an HxWx3 matrix</li>
  <li>A greyscale image sequence is returned as an HxWxN matrix where N is the
sequence length</li>
  <li>A color image sequence is returned as an HxWx3xN matrix where N is the
sequence length</li>
</ul>
<h2>See also</h2>
<p>
<a href="matlab:doc idisp">idisp</a>, <a href="matlab:doc imono">imono</a>, <a href="matlab:doc igamma">igamma</a>, <a href="matlab:doc imwrite">imwrite</a>, <a href="matlab:doc path">path</a></p>
<hr>

<table border="0" width="100%" cellpadding="0" cellspacing="0">
  <tr class="subheader" valign="top"><td>&nbsp;</td></tr></table>
<p class="copy">&copy; 1990-2011 Peter Corke.</p>
</body></html>